import {getLocalUserInfo, setLocalUserInfo} from '~/utils/localUserInfo'

// 永远不要在<script setup>或setup()函数之外定义const state = ref()
// 这样的状态将被所有访问您的网站的用户共享，并可能导致内存泄漏!

const localUserInfo = getLocalUserInfo()

export const useLoginStatus = () =>{
  return useState('loginStatus', () => !!localUserInfo)
}

export const useUserInfo = () =>{
  return useState('userInfo', () => localUserInfo)
}

